home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / gpssdk / GPS.NET Global Positioning SDK 1.4.6.msi / Data1.cab / NewWaypointForm.vb2 < prev    next >
Encoding:
Text File  |  2004-08-24  |  23.3 KB  |  562 lines

  1. Imports StormSource.Gps
  2.  
  3. Public Class NewWaypointForm
  4.     Inherits System.Windows.Forms.Form
  5.  
  6. #Region " Windows Form Designer generated code "
  7.  
  8.     Public Sub New()
  9.         MyBase.New()
  10.  
  11.         'This call is required by the Windows Form Designer.
  12.         InitializeComponent()
  13.  
  14.         'Add any initialization after the InitializeComponent() call
  15.  
  16.     End Sub
  17.  
  18.     'Form overrides dispose to clean up the component list.
  19.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  20.         If disposing Then
  21.             If Not (components Is Nothing) Then
  22.                 components.Dispose()
  23.             End If
  24.         End If
  25.         MyBase.Dispose(disposing)
  26.     End Sub
  27.  
  28.     'Required by the Windows Form Designer
  29.     Private components As System.ComponentModel.IContainer
  30.  
  31.     'NOTE: The following procedure is required by the Windows Form Designer
  32.     'It can be modified using the Windows Form Designer.  
  33.     'Do not modify it using the code editor.
  34.     Friend WithEvents Label2 As System.Windows.Forms.Label
  35.     Friend WithEvents btnCancelButton As System.Windows.Forms.Button
  36.     Friend WithEvents WaypointNameLabel As System.Windows.Forms.Label
  37.     Friend WithEvents WaypointName As System.Windows.Forms.TextBox
  38.     Friend WithEvents SymbolLabel As System.Windows.Forms.Label
  39.     Friend WithEvents TabControl As System.Windows.Forms.TabControl
  40.     Friend WithEvents GeneralTab As System.Windows.Forms.TabPage
  41.     Friend WithEvents Position As System.Windows.Forms.TextBox
  42.     Friend WithEvents WaypointDisplayModeComboBox As System.Windows.Forms.ComboBox
  43.     Friend WithEvents WaypointSymbolComboBox As System.Windows.Forms.ComboBox
  44.     Friend WithEvents WaypointColorComboBox As System.Windows.Forms.ComboBox
  45.     Friend WithEvents ColorLabel As System.Windows.Forms.Label
  46.     Friend WithEvents DisplayModeLabel As System.Windows.Forms.Label
  47.     Friend WithEvents Depth As System.Windows.Forms.TextBox
  48.     Friend WithEvents DepthLabel As System.Windows.Forms.Label
  49.     Friend WithEvents Altitude As System.Windows.Forms.TextBox
  50.     Friend WithEvents AltitudeLabel As System.Windows.Forms.Label
  51.     Friend WithEvents City As System.Windows.Forms.TextBox
  52.     Friend WithEvents CityLabel As System.Windows.Forms.Label
  53.     Friend WithEvents Address As System.Windows.Forms.TextBox
  54.     Friend WithEvents AddressLabel As System.Windows.Forms.Label
  55.     Friend WithEvents Country As System.Windows.Forms.TextBox
  56.     Friend WithEvents CountryLabel As System.Windows.Forms.Label
  57.     Friend WithEvents State As System.Windows.Forms.TextBox
  58.     Friend WithEvents StateLabel As System.Windows.Forms.Label
  59.     Friend WithEvents IntersectingRoad As System.Windows.Forms.TextBox
  60.     Friend WithEvents IntersectingRoadLabel As System.Windows.Forms.Label
  61.     Friend WithEvents FacilityLabel As System.Windows.Forms.Label
  62.     Friend WithEvents Facility As System.Windows.Forms.TextBox
  63.     Friend WithEvents SaveButton As System.Windows.Forms.Button
  64.     Friend WithEvents DescriptionLabel As System.Windows.Forms.Label
  65.     Friend WithEvents Description As System.Windows.Forms.TextBox
  66.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  67.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(NewWaypointForm))
  68.         Me.WaypointDisplayModeComboBox = New System.Windows.Forms.ComboBox
  69.         Me.WaypointSymbolComboBox = New System.Windows.Forms.ComboBox
  70.         Me.WaypointNameLabel = New System.Windows.Forms.Label
  71.         Me.WaypointName = New System.Windows.Forms.TextBox
  72.         Me.btnCancelButton = New System.Windows.Forms.Button
  73.         Me.SaveButton = New System.Windows.Forms.Button
  74.         Me.Position = New System.Windows.Forms.TextBox
  75.         Me.Label2 = New System.Windows.Forms.Label
  76.         Me.Description = New System.Windows.Forms.TextBox
  77.         Me.DescriptionLabel = New System.Windows.Forms.Label
  78.         Me.SymbolLabel = New System.Windows.Forms.Label
  79.         Me.ColorLabel = New System.Windows.Forms.Label
  80.         Me.WaypointColorComboBox = New System.Windows.Forms.ComboBox
  81.         Me.DisplayModeLabel = New System.Windows.Forms.Label
  82.         Me.Depth = New System.Windows.Forms.TextBox
  83.         Me.DepthLabel = New System.Windows.Forms.Label
  84.         Me.Altitude = New System.Windows.Forms.TextBox
  85.         Me.AltitudeLabel = New System.Windows.Forms.Label
  86.         Me.City = New System.Windows.Forms.TextBox
  87.         Me.CityLabel = New System.Windows.Forms.Label
  88.         Me.Address = New System.Windows.Forms.TextBox
  89.         Me.AddressLabel = New System.Windows.Forms.Label
  90.         Me.Country = New System.Windows.Forms.TextBox
  91.         Me.CountryLabel = New System.Windows.Forms.Label
  92.         Me.State = New System.Windows.Forms.TextBox
  93.         Me.StateLabel = New System.Windows.Forms.Label
  94.         Me.IntersectingRoad = New System.Windows.Forms.TextBox
  95.         Me.IntersectingRoadLabel = New System.Windows.Forms.Label
  96.         Me.TabControl = New System.Windows.Forms.TabControl
  97.         Me.GeneralTab = New System.Windows.Forms.TabPage
  98.         Me.FacilityLabel = New System.Windows.Forms.Label
  99.         Me.Facility = New System.Windows.Forms.TextBox
  100.         Me.TabControl.SuspendLayout()
  101.         Me.GeneralTab.SuspendLayout()
  102.         Me.SuspendLayout()
  103.         '
  104.         'WaypointDisplayModeComboBox
  105.         '
  106.         Me.WaypointDisplayModeComboBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  107.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  108.         Me.WaypointDisplayModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  109.         Me.WaypointDisplayModeComboBox.Location = New System.Drawing.Point(120, 126)
  110.         Me.WaypointDisplayModeComboBox.Name = "WaypointDisplayModeComboBox"
  111.         Me.WaypointDisplayModeComboBox.Size = New System.Drawing.Size(264, 21)
  112.         Me.WaypointDisplayModeComboBox.Sorted = True
  113.         Me.WaypointDisplayModeComboBox.TabIndex = 11
  114.         '
  115.         'WaypointSymbolComboBox
  116.         '
  117.         Me.WaypointSymbolComboBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  118.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  119.         Me.WaypointSymbolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  120.         Me.WaypointSymbolComboBox.Location = New System.Drawing.Point(120, 78)
  121.         Me.WaypointSymbolComboBox.Name = "WaypointSymbolComboBox"
  122.         Me.WaypointSymbolComboBox.Size = New System.Drawing.Size(264, 21)
  123.         Me.WaypointSymbolComboBox.Sorted = True
  124.         Me.WaypointSymbolComboBox.TabIndex = 7
  125.         '
  126.         'WaypointNameLabel
  127.         '
  128.         Me.WaypointNameLabel.Location = New System.Drawing.Point(9, 9)
  129.         Me.WaypointNameLabel.Name = "WaypointNameLabel"
  130.         Me.WaypointNameLabel.Size = New System.Drawing.Size(99, 15)
  131.         Me.WaypointNameLabel.TabIndex = 0
  132.         Me.WaypointNameLabel.Text = "Name:"
  133.         '
  134.         'WaypointName
  135.         '
  136.         Me.WaypointName.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  137.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  138.         Me.WaypointName.Location = New System.Drawing.Point(120, 6)
  139.         Me.WaypointName.Name = "WaypointName"
  140.         Me.WaypointName.Size = New System.Drawing.Size(264, 20)
  141.         Me.WaypointName.TabIndex = 1
  142.         Me.WaypointName.Text = ""
  143.         '
  144.         'btnCancelButton
  145.         '
  146.         Me.btnCancelButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  147.         Me.btnCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
  148.         Me.btnCancelButton.Location = New System.Drawing.Point(339, 396)
  149.         Me.btnCancelButton.Name = "btnCancelButton"
  150.         Me.btnCancelButton.Size = New System.Drawing.Size(72, 24)
  151.         Me.btnCancelButton.TabIndex = 2
  152.         Me.btnCancelButton.Text = "Cancel"
  153.         '
  154.         'SaveButton
  155.         '
  156.         Me.SaveButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  157.         Me.SaveButton.DialogResult = System.Windows.Forms.DialogResult.OK
  158.         Me.SaveButton.Location = New System.Drawing.Point(261, 396)
  159.         Me.SaveButton.Name = "SaveButton"
  160.         Me.SaveButton.Size = New System.Drawing.Size(72, 24)
  161.         Me.SaveButton.TabIndex = 1
  162.         Me.SaveButton.Text = "Save"
  163.         '
  164.         'Position
  165.         '
  166.         Me.Position.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  167.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  168.         Me.Position.Location = New System.Drawing.Point(120, 30)
  169.         Me.Position.Name = "Position"
  170.         Me.Position.Size = New System.Drawing.Size(264, 20)
  171.         Me.Position.TabIndex = 3
  172.         Me.Position.Text = ""
  173.         '
  174.         'Label2
  175.         '
  176.         Me.Label2.Location = New System.Drawing.Point(9, 33)
  177.         Me.Label2.Name = "Label2"
  178.         Me.Label2.Size = New System.Drawing.Size(99, 15)
  179.         Me.Label2.TabIndex = 2
  180.         Me.Label2.Text = "Position:"
  181.         '
  182.         'Description
  183.         '
  184.         Me.Description.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  185.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  186.         Me.Description.Location = New System.Drawing.Point(120, 54)
  187.         Me.Description.Name = "Description"
  188.         Me.Description.Size = New System.Drawing.Size(264, 20)
  189.         Me.Description.TabIndex = 5
  190.         Me.Description.Text = ""
  191.         '
  192.         'DescriptionLabel
  193.         '
  194.         Me.DescriptionLabel.Location = New System.Drawing.Point(9, 57)
  195.         Me.DescriptionLabel.Name = "DescriptionLabel"
  196.         Me.DescriptionLabel.Size = New System.Drawing.Size(99, 15)
  197.         Me.DescriptionLabel.TabIndex = 4
  198.         Me.DescriptionLabel.Text = "Description:"
  199.         '
  200.         'SymbolLabel
  201.         '
  202.         Me.SymbolLabel.Location = New System.Drawing.Point(9, 81)
  203.         Me.SymbolLabel.Name = "SymbolLabel"
  204.         Me.SymbolLabel.Size = New System.Drawing.Size(99, 15)
  205.         Me.SymbolLabel.TabIndex = 6
  206.         Me.SymbolLabel.Text = "Symbol:"
  207.         '
  208.         'ColorLabel
  209.         '
  210.         Me.ColorLabel.Location = New System.Drawing.Point(9, 105)
  211.         Me.ColorLabel.Name = "ColorLabel"
  212.         Me.ColorLabel.Size = New System.Drawing.Size(99, 15)
  213.         Me.ColorLabel.TabIndex = 8
  214.         Me.ColorLabel.Text = "Color:"
  215.         '
  216.         'WaypointColorComboBox
  217.         '
  218.         Me.WaypointColorComboBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  219.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  220.         Me.WaypointColorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  221.         Me.WaypointColorComboBox.Location = New System.Drawing.Point(120, 102)
  222.         Me.WaypointColorComboBox.Name = "WaypointColorComboBox"
  223.         Me.WaypointColorComboBox.Size = New System.Drawing.Size(264, 21)
  224.         Me.WaypointColorComboBox.Sorted = True
  225.         Me.WaypointColorComboBox.TabIndex = 9
  226.         '
  227.         'DisplayModeLabel
  228.         '
  229.         Me.DisplayModeLabel.Location = New System.Drawing.Point(9, 129)
  230.         Me.DisplayModeLabel.Name = "DisplayModeLabel"
  231.         Me.DisplayModeLabel.Size = New System.Drawing.Size(99, 15)
  232.         Me.DisplayModeLabel.TabIndex = 10
  233.         Me.DisplayModeLabel.Text = "Display Mode:"
  234.         '
  235.         'Depth
  236.         '
  237.         Me.Depth.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  238.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  239.         Me.Depth.Location = New System.Drawing.Point(120, 174)
  240.         Me.Depth.Name = "Depth"
  241.         Me.Depth.Size = New System.Drawing.Size(264, 20)
  242.         Me.Depth.TabIndex = 15
  243.         Me.Depth.Text = ""
  244.         '
  245.         'DepthLabel
  246.         '
  247.         Me.DepthLabel.Location = New System.Drawing.Point(9, 177)
  248.         Me.DepthLabel.Name = "DepthLabel"
  249.         Me.DepthLabel.Size = New System.Drawing.Size(99, 15)
  250.         Me.DepthLabel.TabIndex = 14
  251.         Me.DepthLabel.Text = "Depth:"
  252.         '
  253.         'Altitude
  254.         '
  255.         Me.Altitude.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  256.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  257.         Me.Altitude.Location = New System.Drawing.Point(120, 150)
  258.         Me.Altitude.Name = "Altitude"
  259.         Me.Altitude.Size = New System.Drawing.Size(264, 20)
  260.         Me.Altitude.TabIndex = 13
  261.         Me.Altitude.Text = ""
  262.         '
  263.         'AltitudeLabel
  264.         '
  265.         Me.AltitudeLabel.Location = New System.Drawing.Point(9, 153)
  266.         Me.AltitudeLabel.Name = "AltitudeLabel"
  267.         Me.AltitudeLabel.Size = New System.Drawing.Size(99, 15)
  268.         Me.AltitudeLabel.TabIndex = 12
  269.         Me.AltitudeLabel.Text = "Altitude:"
  270.         '
  271.         'City
  272.         '
  273.         Me.City.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  274.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  275.         Me.City.Location = New System.Drawing.Point(120, 246)
  276.         Me.City.Name = "City"
  277.         Me.City.Size = New System.Drawing.Size(264, 20)
  278.         Me.City.TabIndex = 21
  279.         Me.City.Text = ""
  280.         '
  281.         'CityLabel
  282.         '
  283.         Me.CityLabel.Location = New System.Drawing.Point(9, 249)
  284.         Me.CityLabel.Name = "CityLabel"
  285.         Me.CityLabel.Size = New System.Drawing.Size(99, 15)
  286.         Me.CityLabel.TabIndex = 20
  287.         Me.CityLabel.Text = "City:"
  288.         '
  289.         'Address
  290.         '
  291.         Me.Address.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  292.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  293.         Me.Address.Location = New System.Drawing.Point(120, 222)
  294.         Me.Address.Name = "Address"
  295.         Me.Address.Size = New System.Drawing.Size(264, 20)
  296.         Me.Address.TabIndex = 19
  297.         Me.Address.Text = ""
  298.         '
  299.         'AddressLabel
  300.         '
  301.         Me.AddressLabel.Location = New System.Drawing.Point(9, 225)
  302.         Me.AddressLabel.Name = "AddressLabel"
  303.         Me.AddressLabel.Size = New System.Drawing.Size(99, 15)
  304.         Me.AddressLabel.TabIndex = 18
  305.         Me.AddressLabel.Text = "Address:"
  306.         '
  307.         'Country
  308.         '
  309.         Me.Country.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  310.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  311.         Me.Country.Location = New System.Drawing.Point(120, 294)
  312.         Me.Country.MaxLength = 2
  313.         Me.Country.Name = "Country"
  314.         Me.Country.Size = New System.Drawing.Size(264, 20)
  315.         Me.Country.TabIndex = 25
  316.         Me.Country.Text = ""
  317.         '
  318.         'CountryLabel
  319.         '
  320.         Me.CountryLabel.Location = New System.Drawing.Point(9, 297)
  321.         Me.CountryLabel.Name = "CountryLabel"
  322.         Me.CountryLabel.Size = New System.Drawing.Size(99, 15)
  323.         Me.CountryLabel.TabIndex = 24
  324.         Me.CountryLabel.Text = "Country:"
  325.         '
  326.         'State
  327.         '
  328.         Me.State.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  329.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  330.         Me.State.Location = New System.Drawing.Point(120, 270)
  331.         Me.State.MaxLength = 2
  332.         Me.State.Name = "State"
  333.         Me.State.Size = New System.Drawing.Size(264, 20)
  334.         Me.State.TabIndex = 23
  335.         Me.State.Text = ""
  336.         '
  337.         'StateLabel
  338.         '
  339.         Me.StateLabel.Location = New System.Drawing.Point(9, 273)
  340.         Me.StateLabel.Name = "StateLabel"
  341.         Me.StateLabel.Size = New System.Drawing.Size(99, 15)
  342.         Me.StateLabel.TabIndex = 22
  343.         Me.StateLabel.Text = "State:"
  344.         '
  345.         'IntersectingRoad
  346.         '
  347.         Me.IntersectingRoad.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  348.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  349.         Me.IntersectingRoad.Location = New System.Drawing.Point(120, 318)
  350.         Me.IntersectingRoad.Name = "IntersectingRoad"
  351.         Me.IntersectingRoad.Size = New System.Drawing.Size(264, 20)
  352.         Me.IntersectingRoad.TabIndex = 27
  353.         Me.IntersectingRoad.Text = ""
  354.         '
  355.         'IntersectingRoadLabel
  356.         '
  357.         Me.IntersectingRoadLabel.Location = New System.Drawing.Point(9, 321)
  358.         Me.IntersectingRoadLabel.Name = "IntersectingRoadLabel"
  359.         Me.IntersectingRoadLabel.Size = New System.Drawing.Size(99, 15)
  360.         Me.IntersectingRoadLabel.TabIndex = 26
  361.         Me.IntersectingRoadLabel.Text = "Intersecting Road:"
  362.         '
  363.         'TabControl
  364.         '
  365.         Me.TabControl.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
  366.                     Or System.Windows.Forms.AnchorStyles.Left) _
  367.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  368.         Me.TabControl.Controls.Add(Me.GeneralTab)
  369.         Me.TabControl.Location = New System.Drawing.Point(9, 9)
  370.         Me.TabControl.Name = "TabControl"
  371.         Me.TabControl.SelectedIndex = 0
  372.         Me.TabControl.Size = New System.Drawing.Size(405, 375)
  373.         Me.TabControl.TabIndex = 0
  374.         '
  375.         'GeneralTab
  376.         '
  377.         Me.GeneralTab.Controls.Add(Me.FacilityLabel)
  378.         Me.GeneralTab.Controls.Add(Me.Facility)
  379.         Me.GeneralTab.Controls.Add(Me.CountryLabel)
  380.         Me.GeneralTab.Controls.Add(Me.State)
  381.         Me.GeneralTab.Controls.Add(Me.StateLabel)
  382.         Me.GeneralTab.Controls.Add(Me.AddressLabel)
  383.         Me.GeneralTab.Controls.Add(Me.Address)
  384.         Me.GeneralTab.Controls.Add(Me.CityLabel)
  385.         Me.GeneralTab.Controls.Add(Me.City)
  386.         Me.GeneralTab.Controls.Add(Me.Country)
  387.         Me.GeneralTab.Controls.Add(Me.IntersectingRoad)
  388.         Me.GeneralTab.Controls.Add(Me.WaypointColorComboBox)
  389.         Me.GeneralTab.Controls.Add(Me.WaypointDisplayModeComboBox)
  390.         Me.GeneralTab.Controls.Add(Me.DisplayModeLabel)
  391.         Me.GeneralTab.Controls.Add(Me.WaypointNameLabel)
  392.         Me.GeneralTab.Controls.Add(Me.IntersectingRoadLabel)
  393.         Me.GeneralTab.Controls.Add(Me.Label2)
  394.         Me.GeneralTab.Controls.Add(Me.Depth)
  395.         Me.GeneralTab.Controls.Add(Me.WaypointSymbolComboBox)
  396.         Me.GeneralTab.Controls.Add(Me.WaypointName)
  397.         Me.GeneralTab.Controls.Add(Me.Position)
  398.         Me.GeneralTab.Controls.Add(Me.Description)
  399.         Me.GeneralTab.Controls.Add(Me.AltitudeLabel)
  400.         Me.GeneralTab.Controls.Add(Me.DepthLabel)
  401.         Me.GeneralTab.Controls.Add(Me.SymbolLabel)
  402.         Me.GeneralTab.Controls.Add(Me.Altitude)
  403.         Me.GeneralTab.Controls.Add(Me.ColorLabel)
  404.         Me.GeneralTab.Controls.Add(Me.DescriptionLabel)
  405.         Me.GeneralTab.Location = New System.Drawing.Point(4, 22)
  406.         Me.GeneralTab.Name = "GeneralTab"
  407.         Me.GeneralTab.Size = New System.Drawing.Size(397, 349)
  408.         Me.GeneralTab.TabIndex = 0
  409.         Me.GeneralTab.Text = "General"
  410.         '
  411.         'FacilityLabel
  412.         '
  413.         Me.FacilityLabel.Location = New System.Drawing.Point(9, 201)
  414.         Me.FacilityLabel.Name = "FacilityLabel"
  415.         Me.FacilityLabel.Size = New System.Drawing.Size(99, 15)
  416.         Me.FacilityLabel.TabIndex = 16
  417.         Me.FacilityLabel.Text = "Facility Name:"
  418.         '
  419.         'Facility
  420.         '
  421.         Me.Facility.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  422.                     Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
  423.         Me.Facility.Location = New System.Drawing.Point(120, 198)
  424.         Me.Facility.Name = "Facility"
  425.         Me.Facility.Size = New System.Drawing.Size(264, 20)
  426.         Me.Facility.TabIndex = 17
  427.         Me.Facility.Text = ""
  428.         '
  429.         'NewWaypointForm
  430.         '
  431.         Me.AcceptButton = Me.SaveButton
  432.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  433.         Me.CancelButton = Me.btnCancelButton
  434.         Me.ClientSize = New System.Drawing.Size(423, 433)
  435.         Me.Controls.Add(Me.TabControl)
  436.         Me.Controls.Add(Me.btnCancelButton)
  437.         Me.Controls.Add(Me.SaveButton)
  438.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
  439.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  440.         Me.MaximizeBox = False
  441.         Me.MinimizeBox = False
  442.         Me.Name = "NewWaypointForm"
  443.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  444.         Me.Text = "Add Waypoint"
  445.         Me.TabControl.ResumeLayout(False)
  446.         Me.GeneralTab.ResumeLayout(False)
  447.         Me.ResumeLayout(False)
  448.  
  449.     End Sub
  450.  
  451. #End Region
  452.  
  453.     ' Stores information about a GPS device
  454.     Private WithEvents pDevice As Device
  455.  
  456.     ' Returns/sets the device containing waypoint information
  457.     Public Property Device() As Device
  458.         Get
  459.             Return pDevice
  460.         End Get
  461.         Set(ByVal Value As Device)
  462.             ' Remember the waypoint for editing later on
  463.             pDevice = Value
  464.  
  465.             ' Populate the combo box with the list of available waypoint symbols
  466.             WaypointSymbolComboBox.Items.Clear()
  467.             WaypointSymbolComboBox.Items.AddRange(pDevice.GetSymbols)
  468.             WaypointSymbolComboBox.SelectedIndex = WaypointSymbolComboBox.FindString("Dot")
  469.  
  470.             ' Populate the color combo box with the list of available waypoint symbols
  471.             WaypointColorComboBox.Items.Clear()
  472.             WaypointColorComboBox.Items.AddRange(pDevice.GetColors)
  473.             WaypointColorComboBox.SelectedIndex = WaypointColorComboBox.FindString("Default")
  474.  
  475.             ' Populate the display mode box with the list of available waypoint symbols
  476.             WaypointDisplayModeComboBox.Items.Clear()
  477.             WaypointDisplayModeComboBox.Items.AddRange(pDevice.GetDisplayModes)
  478.             WaypointDisplayModeComboBox.SelectedIndex = WaypointDisplayModeComboBox.FindString("SymbolOnly")
  479.  
  480.             ' Now, enable/disable features based on the capabilities of the device
  481.             Description.Enabled = pDevice.SupportsWaypointComment
  482.             Address.Enabled = pDevice.SupportsWaypointAddress
  483.             WaypointSymbolComboBox.Enabled = pDevice.SupportsWaypointSymbol
  484.             WaypointColorComboBox.Enabled = pDevice.SupportsWaypointColor
  485.             WaypointDisplayModeComboBox.Enabled = pDevice.SupportsWaypointDisplayMode
  486.             Facility.Enabled = pDevice.SupportsWaypointFacility
  487.             Address.Enabled = pDevice.SupportsWaypointAddress
  488.             City.Enabled = pDevice.SupportsWaypointCity
  489.             State.Enabled = pDevice.SupportsWaypointState
  490.             Country.Enabled = pDevice.SupportsWaypointCountry
  491.             IntersectingRoad.Enabled = pDevice.SupportsWaypointIntersectingRoad
  492.         End Set
  493.     End Property
  494.  
  495.     Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
  496.         Dim NewWaypoint As Waypoint
  497.         ' Now set the waypoint's properties
  498.         Try
  499.             ' Create a new waypoint 
  500.             NewWaypoint = New Waypoint()
  501.             ' Update the waypoint with values from the form
  502.             NewWaypoint.Name = Me.WaypointName.Text
  503.             ' Update the position
  504.             Dim NewPosition As Position = StormSource.GPS.Position.Parse(Position.Text)
  505.             NewWaypoint.Latitude = NewPosition.Latitude
  506.             NewWaypoint.Longitude = NewPosition.Longitude
  507.             ' Update the comment
  508.             NewWaypoint.Description = Me.Description.Text
  509.             ' Update the symbol
  510.             NewWaypoint.Symbol = System.Enum.Parse(GetType(WaypointSymbol), WaypointSymbolComboBox.Text)
  511.             ' Update the color
  512.             NewWaypoint.Color = System.Enum.Parse(GetType(WaypointColor), WaypointColorComboBox.Text)
  513.             ' Update the symbol
  514.             NewWaypoint.DisplayMode = System.Enum.Parse(GetType(WaypointDisplayMode), WaypointDisplayModeComboBox.Text)
  515.             ' Update the altitude
  516.             Dim NewAltitude As Distance = Distance.Parse(Me.Altitude.Text)
  517.             NewWaypoint.Altitude = NewAltitude
  518.             ' Update the depth
  519.             Dim NewDepth As Distance = Distance.Parse(Me.Depth.Text)
  520.             NewWaypoint.Depth = NewDepth
  521.             ' Update the facility
  522.             NewWaypoint.Facility = Me.Facility.Text
  523.             ' Update the address
  524.             NewWaypoint.Address = Me.Address.Text
  525.             NewWaypoint.City = Me.City.Text
  526.             NewWaypoint.State = Me.State.Text
  527.             NewWaypoint.Country = Me.Country.Text
  528.             ' Update the intersecting road/intersection
  529.             NewWaypoint.IntersectingRoad = Me.IntersectingRoad.Text
  530.         Catch ex As Exception
  531.             ' Some error occurred while try to update waypoint information
  532.             MessageBox.Show(ex.Message, "Form Information is Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  533.             Exit Sub
  534.         End Try
  535.         Try
  536.             ' Tell the waypoint which kind of GPS device to use
  537.             NewWaypoint.Device = Me.Device
  538.             ' Save this waypoint to the device
  539.             NewWaypoint.Save()
  540.             ' Refresh the waypoints collection
  541.             NewWaypoint.Device.Receiver.Waypoints.Refresh()
  542.             ' And unload this form
  543.             Close()
  544.         Catch ex As Exception
  545.             ' Notify of the problem saving the waypoint
  546.             MessageBox.Show(ex.Message, "Unable to Create Waypoint", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  547.             Exit Sub
  548.         End Try
  549.     End Sub
  550.  
  551.     ' Raised when editing of a waypoint has been cancelled
  552.     Private Sub btnCancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelButton.Click
  553.         Close()
  554.     End Sub
  555.  
  556.     ' Raised when the device becomes identified
  557.     Private Sub pDevice_DeviceIdentified(ByVal sender As Object, ByVal e As StormSource.GPS.DeviceEventArgs) Handles pDevice.DeviceIdentified
  558.         Me.Device = e.Device
  559.     End Sub
  560.  
  561. End Class
  562.